var app = getApp();
Page({
    data:{
        inited : false,
    },
    onLoad:function(options){
        var self = this;
        var id = options.id ? options.id : 0;
        app.com.http('helpme','POST',{op:'info',id:id},0,false,function(res){
            if (!res.data.errno) {
                self.setData({
                    Pagetheme : res.data.data.params.style,
                    info : res.data.data.info,
                },function(){
                    self.setData({
                        inited : true,
                    });
                });

                wx.setNavigationBarTitle({
                  title:  res.data.data.info.quest,
                });

                var octoparse = require('../resource/wxParse/html2json2.js');
                var transData = octoparse.parse(res.data.data.info.answer);
                self.setData({
                    nodes : transData,
                })

                // 关闭下拉刷新
                wx.stopPullDownRefresh();
            }else{
                app.com.alert(res.data.message,function(){
                    app.com.backPage(options.zfid);
                });
            }
        });
       
    },
    onShareAppMessage : function(){
        var self = this;
        return {
            title: self.data.sharedata.title,
            path: self.data.sharedata.path,
            imageUrl : self.data.sharedata.img,
        }
    },
    location : function( e ){
        app.com.location( e );
    },
    otherapp : function( e ){
        app.com.otherapp( e );
    },
    navigateto : function( e ){
        app.com.navigateto( e );
    },
    redirectto : function( e ){
        app.com.redirectto( e );
    },    
    callphone : function(e){
        app.com.callphone( e );
    },
    showimages : function( e ){
        app.com.showimages( e );
    },
    FormIdsubmit : function(e){
        if( app.globalData.formarr.length <= 20 ) app.globalData.formarr.push(e.detail.formId);
    },
    
})